// TableChar.h: interface for the CTableChar class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_TABLECHAR_H__47CC64C4_2A26_4007_9ED6_ACC0F989E918__INCLUDED_)
#define AFX_TABLECHAR_H__47CC64C4_2A26_4007_9ED6_ACC0F989E918__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define PIN_NONE 0
#define PIN_SINGLE 1
#define PIN_THIN 2
#define PIN_THICK 3
#define PIN_DOUBLE 4


#define PIN_INDEX_LEFT 0
#define PIN_INDEX_TOP 1
#define PIN_INDEX_RIGHT 2
#define PIN_INDEX_BOTTOM 3

#define PIN_DIR_ANY 0x0
#define PIN_DIR_LEFT 0x1
#define PIN_DIR_TOP 0x2
#define PIN_DIR_RIGHT 0x4
#define PIN_DIR_BOTTOM 0x8
#define PIN_DIR_ALL (PIN_DIR_LEFT|PIN_DIR_TOP|PIN_DIR_RIGHT|PIN_DIR_BOTTOM)

struct CTableChar  
{
public:
	WCHAR c;
	BYTE pins[4]; // {left, top, right, bottom}

	static CTableChar FindChar(LPCTSTR sc);
	static CTableChar FindChar(WCHAR wc);
	CString GetMatchChars(int pinIndex, BYTE targetPinDirs);
	BOOL MatchPin(int pinIndex, const CTableChar& tc);
	BYTE GetPinDirs() const;
};

extern CTableChar gTableChars[];
extern const int gTableCharCount;

#endif // !defined(AFX_TABLECHAR_H__47CC64C4_2A26_4007_9ED6_ACC0F989E918__INCLUDED_)
